﻿using System;

namespace DNEL.Extensions
{
    /// <summary>
    /// 
    /// </summary>
    public static class DNELInfo
    {
        /// <summary>
        /// 
        /// </summary>
        public static string Version
        {
            get
            {
                return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static string Path
        {
            get
            {
                string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
                UriBuilder uri = new UriBuilder(codeBase);
                string path = Uri.UnescapeDataString(uri.Path);
                return System.IO.Path.GetDirectoryName(path);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static string FullPath
        {
            get
            {
                return System.IO.Path.Combine(Path, NameExt);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static string Name
        {
            get
            {
                return System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static string NameExt
        {
            get
            {
                return System.IO.Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static string FullName
        {
            get
            {
                return System.Reflection.Assembly.GetExecutingAssembly().GetName().FullName;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static string ProcessorArchitecture
        {
            get
            {
                return System.Reflection.Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture.ToString();
            }
        }
    }
}
